Unit this, u;
Query q;

this = owner.AsUnit;
if (!.IsValid) return;

while (true)
{
	Sleep(500);
	q = Intersect(ObjsInSight(this, "Military"), ClassPlayerObjs("Military", .player));
	if (q.count < 2){
		Sleep(5000);
		continue;
	}
	u = q.GetObjList[rand(q.count)].AsUnit;
	if (u == this)
	continue;
	if (u.IsDead)
	continue;
	if(!u.IsMilitary)
	continue;
	if(u.health == u.maxhealth)
	continue;
	
	u.Heal(300);
	CreateFeedback("Heal", u);
	Sleep(4500);
}
